import { request } from "@umijs/max";

// /dev-api/ying/customer/list
export const getCustomerList = (params?: any) => {
  return request("/api/ying/customer/list", {
    method: "GET",
    params,
  });
};
///dev-api/ying/customer/add
export const addCustomer = (data: any) => {
  return request("/api/ying/customer/add", {
    method: "POST",
    data,
  });
};

// /dev-api/ying/customer/update
export const updateCustomer = (data: any) => {
  return request("/api/ying/customer/update", {
    method: "PUT",
    data,
  });
};
// /dev-api/ying/customer/delete
export const deleteCustomer = (id: number) => {
  return request(`/api/ying/customer/delete?id=${id}`, {
    method: "DELETE",
  });
};
// ​/dev-api​/ying​/customer​/detail​/{id}
export const getCustomerDetail = (id: number) => {
  return request(`/api/ying/customer/detail/${id}`, {
    method: "GET",
  });
};
// ​/dev-api​/ying​/opportunity​/customer-oppo​/{customerId}查询客户干系人项目
export const getCustomerOpportunities = (customerId: number) => {
  return request(`/api/ying/opportunity/customer-oppo/${customerId}`, {
    method: "GET",
  });
};
